xen/arm: Introduce support for Renesas R-Car Gen2 platform
authorIurii Konovalenko <iurii.konovalenko@globallogic.com>
Wed, 4 Feb 2015 13:05:24 +0000 (15:05 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 5 Feb 2015 12:20:04 +0000 (12:20 +0000)
Signed-off-by: Iurii Konovalenko <iurii.konovalenko@globallogic.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/platforms/Makefile
xen/arch/arm/platforms/rcar2.c [new file with mode: 0644]

index 8f47c168ea2e5a6cf42a27f29a6cc79006ddad44..e173fec1d587edd0bbb97996a60270027022056b 100644 (file)
@@ -4,5 +4,6 @@ obj-$(CONFIG_ARM_32) += exynos5.o
 obj-$(CONFIG_ARM_32) += midway.o
 obj-$(CONFIG_ARM_32) += omap5.o
 obj-$(CONFIG_ARM_32) += sunxi.o
+obj-$(CONFIG_ARM_32) += rcar2.o
 obj-$(CONFIG_ARM_64) += seattle.o
 obj-$(CONFIG_ARM_64) += xgene-storm.o
diff --git a/xen/arch/arm/platforms/rcar2.c b/xen/arch/arm/platforms/rcar2.c
new file mode 100644 (file)
index 0000000..aef544c
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * xen/arch/arm/platforms/rcar2.c
+ *
+ * Renesas R-Car Gen2 specific settings
+ *
+ * Iurii Konovalenko <iurii.konovalenko@globallogic.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <xen/mm.h>
+#include <xen/vmap.h>
+#include <asm/platform.h>
+#include <asm/io.h>
+
+#define RCAR2_RAM_ADDR                         0xE63C0000
+#define RCAR2_RAM_SIZE                         0x1000
+#define RCAR2_SMP_START_OFFSET                 0xFFC
+
+static int __init rcar2_smp_init(void)
+{
+    void __iomem *pram;
+
+    /* map ICRAM */
+    pram = ioremap_nocache(RCAR2_RAM_ADDR, RCAR2_RAM_SIZE);
+    if( !pram )
+    {
+        dprintk( XENLOG_ERR, "Unable to map RCAR2 ICRAM\n");
+        return -ENOMEM;
+    }
+
+    /* setup reset vectors */
+    writel(__pa(init_secondary), pram + RCAR2_SMP_START_OFFSET);
+    iounmap(pram);
+
+    sev();
+
+    return 0;
+}
+
+static const char const *rcar2_dt_compat[] __initdata =
+{
+    "renesas,lager",
+    NULL
+};
+
+PLATFORM_START(rcar2, "Renesas R-Car Gen2")
+    .compatible = rcar2_dt_compat,
+    .cpu_up = cpu_up_send_sgi,
+    .smp_init = rcar2_smp_init,
+
+    .dom0_gnttab_start = 0xc0000000,
+    .dom0_gnttab_size = 0x20000,
+PLATFORM_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */